
export let HTTPS_PROTOCOL = "https";
export const getProtocolWsUrl = (url) => {
  let protocol = window?.location?.protocol || "https:";
  let ws_protocol = "ws";
  if (protocol.includes(HTTPS_PROTOCOL)) {
    ws_protocol = "wss";
    // 没有 wss 协议，暂时使用ws
    // ws_protocol = "ws";
  }
  return `${ws_protocol}://${url}`;
};
